package com.qike.duola.service.impl;

import com.qike.duola.service.NoticeService;
import com.qike.duola.utils.sms.DuolaSms;
import com.qike.duola.utils.voice.DuolaCall;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Author: Eric.zhou
 * @Date: 2020/11/13 16:02
 */
@Service
public class NoticeServiceImpl implements NoticeService {
    /**
     * 发货
     *
     * @param phone
     * @param carNo
     * @param projectName
     * @param distance
     */
    @Override
    @Async
    public void sendGoods(String phone, String carNo, String projectName, String distance) {
        try {
            DuolaSms.sendGoodsCall(phone,carNo,projectName,distance);
            DuolaCall.sendGoodsCall(phone,carNo,projectName,distance);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 装料
     *
     * @param phone
     * @param carNo
     * @param plan
     * @param lastCarNo
     */
    @Override
    @Async
    public void loadGoods(String phone, String carNo, String plan, String lastCarNo) {
        try {
            DuolaSms.loadGoods(phone,carNo,plan,lastCarNo);
            DuolaCall.loadGoods(phone,carNo,plan,lastCarNo);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
